using System;
using System.IO;
using System.Collections.Generic;
using System.Configuration;
using Subsync;

//IKVM-specific
using org.tmatesoft.svn.core;
using org.tmatesoft.svn.core.wc;

namespace Subsync.Test
{

	public class HelloWorld : App
	{

		public HelloWorld ()
		{
		}
		
		public override Dictionary<string, List<object>> getTokens ()
		{
			Dictionary<string, List<object>> ret = new Dictionary<string, List<object>> ();
			ret.Add("helloworld",new List<object>() {"hw","helloworld"});
			ret.Add("say",new List<object>() {"s","say"});
			ret.Add("config",new List<object>() {"nube"});
			//ret.Add("checkout",new List<object>() {"1","-co","--checkout"});
			//ret.Add("update",new List<object>() {"1","-up","--update"});
			return ret;
		}
		
		public override List<KeyValuePair<string,initPointer>> getInitPointers() {
			List<KeyValuePair<string,initPointer>> ret = new List<KeyValuePair<string,initPointer>>();
			ret.Add(new KeyValuePair<string,initPointer>("helloworld",new initPointer(this.sayHelloWorld)));
			ret.Add(new KeyValuePair<string,initPointer>("say",new initPointer(this.saySomething)));
			ret.Add(new KeyValuePair<string,initPointer>("config",new initPointer(this.testConfig)));
			//ret.Add(new KeyValuePair<string,initPointer>("checkout",new initPointer(this.checkOut)));
			//ret.Add(new KeyValuePair<string,initPointer>("update",new initPointer(this.update)));
			return ret;
		}
		
		public void sayHelloWorld(Dictionary<string,List<object>> tokens) {
			Console.WriteLine("Hello World!");
		}
		
		public void saySomething(Dictionary<string,List<object>> tokens) {
			Console.WriteLine("{0} {1}", tokens["say"][0], tokens["say"][1]);
		}
		
		public void testConfig(Dictionary<string,List<object>> tokens) {
			Console.WriteLine(ConfigurationManager.AppSettings["Key1"]);
		}
		
	}
}